package com.dave.configclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
@EnableEurekaClient
@RefreshScope
public class ConfigClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigClientApplication.class, args);
    }


    @Value("${foo}")
    String foo;
    @RequestMapping(value = "/hi")
    public String hi(){
        return foo;
    }


    ///////////////////////////////////////////////////////////////////////////
    // /** 
    // *  Spring Cloud Bus 消息总线 实现通知微服务架构的配置文件的更改
    // * 添加bus-rmqp依赖
    // * 暴露接口 
    // * management: 
    // *   endpoints: 
    // *     web: 
    // *       exposure: 
    // *         include: ["health","info","bus-refresh"] 
    // * 
    // *  post访问 
    // * http://localhost:8881/actuator/bus-refresh 
    // * 
    // * postman发送post请求
    // * 
    // * 要实现动态换参数需要在引用配置的类加上 @RefreshScope 
    // * 
    // */  
    ///////////////////////////////////////////////////////////////////////////
}
